﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Krile.Forms.ConfigForm.Children
{
    public partial class SystemBehavior : Krile.Kernel.Control.ConfigPage
    {
        public SystemBehavior()
        {
            InitializeComponent();
        }

        private void SystemBehavior_Load(object sender, EventArgs e)
        {
            ShowMainWindowOnStartup.Checked = Core.Config.Behavior.ShowMainWindowOnStartup;
            ShowSplashScreen.Checked = Core.Config.Behavior.ShowSplashScreen;
            SendTrayOnMinimize.Checked = Core.Config.Behavior.SendTrayOnMinimize;
            ExitOnWindowClose.Checked = Core.Config.Behavior.ExitOnWindowClose;
            PictureSaveLimitMinutes.Value = Core.Config.Behavior.PictureSaveLimitMinutes;
            CheckUpdateOnStartup.Checked = Core.Config.Behavior.AutomaticUpdate;
            TrayClickToShowPostbox.Checked = Core.Config.Behavior.TrayClickToShowPostBox;
            WheelScrollHeight.Value = Core.Config.Behavior.WheelScrollHeight;

        }

        public override void Apply()
        {
            Core.Config.Behavior.AutomaticUpdate = CheckUpdateOnStartup.Checked;
            Core.Config.Behavior.ExitOnWindowClose = ExitOnWindowClose.Checked;
            Core.Config.Behavior.ShowMainWindowOnStartup = ShowMainWindowOnStartup.Checked;
            Core.Config.Behavior.ShowSplashScreen = ShowSplashScreen.Checked;
            Core.Config.Behavior.SendTrayOnMinimize = SendTrayOnMinimize.Checked;
            Core.Config.Behavior.TrayClickToShowPostBox = TrayClickToShowPostbox.Checked;
            Core.Config.Behavior.PictureSaveLimitMinutes = (int)PictureSaveLimitMinutes.Value;
            Core.Config.Behavior.WheelScrollHeight = (int)WheelScrollHeight.Value;
            base.Apply();
        }
    }
}
